var status = -1;
var selectionLog = [];

function action(e, d, c) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = c;
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            cm.setNumberForQuestInfo(64005, "duringEvent", 0);
            var a = cm.getNumberFromQuestInfo(64006, "Ec");
            if (a > 0) {
                var f = cm.getMap().getPortal(a - 1).getPosition();
                cm.onTeleport(1, cm.getPlayer().getId(), f.getX(), f.getY())
            }
            var d = Math.min(0, Math.floor((a - 1) % 8 / 2));
            for (var b = 0; b < 4; b++) {
                cm.monadForceMove(b, b == d ? 1 : 0, 0);
                cm.onSetBackEffect(b, b == d ? 1 : 0, 1, 0, 0)
            }
            cm.getPlayer().removeAndroid();
            cm.getPlayer().unequipAllSpawnPets();
            cm.useItem(2210207, false);
            cm.setPartnerAction(1, 9400643, 80011648, 120, 200, 0);
            cm.setPartnerAction(1, 9400647, 80011650, 190, 200, 0);
            cm.setPartnerAction(1, 9400648, 80011651, 260, 200, 0);
            cm.setPartnerAction(1, 9400644, 80011652, 210, 200, 0);
            cm.setPartnerAction(1, 9400649, 80011654, 220, 200, 0);
            cm.setPartnerAction(1, 9400650, 80011655, 250, 200, 0);
            cm.setPartnerAction(1, 9400651, 80011656, 280, 200, 0);
            cm.setPartnerAction(1, 9400652, 80011657, 310, 200, 0);
            cm.setPartnerAction(1, 9400653, 80011654, 260, 200, 0);
            cm.setPartnerAction(1, 9400654, 80011654, 330, 200, 0);
            cm.setPartnerAction(1, 9400655, 80011655, 400, 200, 0);
            cm.setPartnerAction(1, 9400656, 80011656, 470, 200, 0);
            cm.setPartnerAction(1, 9400657, 80011656, 540, 200, 0);
            cm.setPartnerAction(1, 9400658, 80011657, 610, 200, 0);
            cm.莫奈德_特效(null, [7, (a - 1) * 5]);
            cm.莫奈德_特效(null, [8, 0, 0, 0, 0]);
            cm.莫奈德_特效(null, [0, 2]);
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};